//
//  HNHNHappyFamilyAboutMeSelectController.m
//  XDEducation
//
//  Created by 星道 on 17/6/9.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "HNHNHappyFamilyAboutMeSelectController.h"
#import "HNHappyFamilyAboutMeController.h"

@interface HNHNHappyFamilyAboutMeSelectController ()
/** 该数组存放字典对象的静态数据，格式@[@{@"Name":@"",@"ImgName":@""}] */
@property (nonatomic, strong) NSArray <NSDictionary *>*DataArr;
@end

@implementation HNHNHappyFamilyAboutMeSelectController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"关于孩子";
    self.tableView.tableHeaderView = [UIView new];
    self.tableView.tableFooterView = [UIView new];
}





#pragma mark - TableView Delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.DataArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *Cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    if (Cell == nil)
    {
        Cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"Cell"];
        Cell.selectionStyle = UITableViewCellSelectionStyleNone;
        Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        Cell.textLabel.font = [UIFont systemFontOfSize:14.f];
        Cell.textLabel.textColor = UIColorFromRGB(0x4c4c4c);
    }
    Cell.textLabel.text = self.DataArr[indexPath.row][@"Name"];
    Cell.imageView.image = [UIImage imageNamed:self.DataArr[indexPath.row][@"ImgName"]];

    return Cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    HNHappyFamilyAboutMeController *VC = [[HNHappyFamilyAboutMeController alloc] init];
    VC.HNHappyFamilyAboutMeType = indexPath.row;
    [self.navigationController pushViewController:VC animated:YES];
}



#pragma mark - Setter
- (NSArray<NSDictionary *> *)DataArr
{
    if (!_DataArr)
    {
        _DataArr = @[
                     @{@"Name":@"行为记录",@"ImgName":@"kid_icon_behavior_record_default"},
                     @{@"Name":@"成长建议",@"ImgName":@"kid_icon_grow_up_default"},
                     @{@"Name":@"行为建议",@"ImgName":@"kid_icon_record_default"},
                     ];
    }
    return _DataArr;
}
@end
